package com.djmw.mouse.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

@Entity
@Table(name = "t_cv_working_experience")
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonIgnoreProperties(ignoreUnknown = true)
public class CvWorkingExperience extends IdEntity {

    private CvLang cvLang;
    private Integer order;
    private Integer startDate; // YYYYMM
    private Integer endDate = 0; // YYYYMM
    private Integer industry;
    private String company;
    private Integer companySize;
    private Integer companyType;
    private String department;
    private String position;
    private String description;
    private String reportTo;
    private Integer followerCount;
    private String witness;
    private String dimissionReason;
    private String performance;
    private char isOversea = 'n';

    public CvWorkingExperience() {
    }

    @ManyToOne
    @JoinColumn(name = "c_cv_lang_id")
    public CvLang getCvLang() {
        return cvLang;
    }
    public void setCvLang(CvLang cvLang) {
        this.cvLang = cvLang;
    }

    @Column(name = "c_order")
    @JsonProperty("order")
    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    @Column(name = "c_start_date")
    @JsonProperty("startDate")
    public Integer getStartDate() {
        return startDate;
    }
    public void setStartDate(Integer startDate) {
        this.startDate = startDate == null ? 0 : startDate.intValue();
    }

    @Column(name = "c_end_date")
    @JsonProperty("endDate")
    public Integer getEndDate() {
        return endDate;
    }
    public void setEndDate(Integer endDate) {
        this.endDate = endDate == null ? 0 : endDate.intValue();
    }

    @Column(name = "c_industry")
    @JsonProperty("industry")
    public Integer getIndustry() {
        return industry;
    }
    public void setIndustry(Integer industry) {
        this.industry = industry == null ? 0 : industry.intValue();
    }

    @Column(name = "c_company")
    @JsonProperty("company")
    public String getCompany() {
        return company;
    }
    public void setCompany(String company) {
        this.company = company;
    }

    @Column(name = "c_company_size")
    @JsonProperty("companySize")
    public Integer getCompanySize() {
        return companySize;
    }
    public void setCompanySize(Integer companySize) {
        this.companySize = companySize == null ? 0 : companySize;
    }

    @Column(name = "c_company_type")
    @JsonProperty("companyType")
    public Integer getCompanyType() {
        return companyType;
    }
    public void setCompanyType(Integer companyType) {
        this.companyType = companyType == null ? 0 : companyType;
    }

    @Column(name = "c_department")
    @JsonProperty("department")
    public String getDepartment() {
        return department;
    }
    public void setDepartment(String department) {
        this.department = department;
    }

    @Column(name = "c_position")
    @JsonProperty("position")
    public String getPosition() {
        return position;
    }
    public void setPosition(String position) {
        this.position = position;
    }

    @Column(name = "c_description")
    @JsonProperty("description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


    @Column(name = "c_report_to")
    @JsonProperty("reportTo")
    public String getReportTo() {
        return reportTo;
    }
    public void setReportTo(String reportTo) {
        this.reportTo = reportTo;
    }

    @Column(name = "c_follower_count")
    @JsonProperty("followerCount")
    public Integer getFollowerCount() {
        return followerCount;
    }
    public void setFollowerCount(Integer followerCount) {
        this.followerCount = followerCount == null ? 0 : followerCount.intValue();
    }

    @Column(name = "c_witness")
    @JsonProperty("witness")
    public String getWitness() {
        return witness;
    }
    public void setWitness(String witness) {
        this.witness = witness;
    }

    @Column(name = "c_dimission_reason")
    @JsonProperty("dimissionReason")
    public String getDimissionReason() {
        return dimissionReason;
    }
    public void setDimissionReason(String dimissionReason) {
        this.dimissionReason = dimissionReason;
    }

    @Column(name = "c_performance")
    @JsonProperty("performance")
    public String getPerformance() {
        return performance;
    }
    public void setPerformance(String performance) {
        this.performance = performance;
    }

    @Column(name = "c_is_oversea")
    @JsonProperty("oversea")
    public char getIsOversea() {
        return isOversea;
    }
    public void setIsOversea(Character isOversea) {
        this.isOversea = isOversea == null ? 'n' : isOversea.charValue();
    }
}
